package com.scrx.ymg.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.scrx.ymg.service.supermarket.ISuperMarketService;

@Controller
@RequestMapping("/loginAction")
public class LoginAction {
	
	@Autowired
	private ISuperMarketService  sms;
	
	/**
	 * 微信小程序用户登录
	 */
	@RequestMapping("/login")
	public void login(){
		
		
	}
	
	/**
	 * 总部修改密码
	 * @param superId
	 * @param oldPassWord
	 * @param newPassWord
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value ="/updatePassWord",produces = "text/json;charset=UTF-8")
	public String updatePassWord(String oldPassWord,String newPassWord){
		return sms.updatePassWord(oldPassWord, newPassWord);
	}
	
	/**
	 * 超市修改密码
	 * @param superId
	 * @param oldPassWord
	 * @param newPassWord
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value ="/modificationPassWord",produces = "text/json;charset=UTF-8")
	public String modificationPassWord(int superId,String oldPassWord,String newPassWord){
		return sms.modificationPassWord(superId, oldPassWord, newPassWord);
	}
	
	/**
	 * 代理商修改密码
	 * @param superId
	 * @param oldPassWord
	 * @param newPassWord
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value ="/modificationPassWordByAgent",produces = "text/json;charset=UTF-8")
	public String modificationPassWordByAgent(int agentId,String oldPassWord,String newPassWord){
		return sms.modificationPassWordByAgent(agentId, oldPassWord, newPassWord);
	}

}
